//
//  UIView+UPView.m
//  LoveHappyShopping
//
//  Created by 白水非泉 on 16/6/23.
//  Copyright © 2016年 白水非泉. All rights reserved.
//

#import "UIView+UPView.h"

@implementation UIView (UPView)
-(void)setX:(int)x{
    CGRect rect=self.frame;
    rect.origin.x=x;
    self.frame=rect;
}
-(int)x{
    return self.frame.origin.x;
}
-(void)setY:(int)y{
    CGRect rect=self.frame;
    rect.origin.y=y;
    self.frame=rect;
}
-(int)y{
    return self.frame.origin.y;
}
-(void)setWidth:(CGFloat)width{
    CGRect rect=self.frame;
    rect.size.width=width;
    self.frame=rect;
}
-(CGFloat)width{
    return self.frame.size.width;
}
-(void)setHeight:(CGFloat)height{
    CGRect rect=self.frame;
    rect.size.height=height;
    self.frame=rect;
}
-(CGFloat)height{
    return self.frame.size.height;
}

- (void)setOrigin:(CGPoint)origin
{
    CGRect rect = self.frame;
    rect.origin = origin;
    self.frame = rect;
}
- (CGPoint)origin
{
    return self.frame.origin;
}
- (void)setSize:(CGSize)size
{
    CGRect rect = self.frame;
    rect.size = size;
    self.frame = rect;
}
- (CGSize)size
{
    return self.frame.size;
}

- (void)setOriginX:(CGFloat)x originY:(CGFloat)y width:(CGFloat)width height:(CGFloat)height
{
    CGRect rect = self.frame;
    rect.origin.x = x;
    rect.origin.y = y;
    rect.size.width = width;
    rect.size.height = height;
    self.frame = rect;
}
@end
